package com.san.dissertation.bpm.model;

import java.util.List;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import com.san.dissertation.annotation.CascadeSave;

@Document
public class Process {

	@Id
	private String processId;
	private String name;
	private String key;
	private String resourceName;
	@Indexed
	private int total;
	@Indexed
	private int complete;
	@Indexed
	private int inProgress;
	
	@DBRef
	@CascadeSave
	private List<ProcessPath> path;

	public String getProcessId() {
		return processId;
	}

	public void setProcessId(String processId) {
		this.processId = processId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getResourceName() {
		return resourceName;
	}

	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getComplete() {
		return complete;
	}

	public void setComplete(int complete) {
		this.complete = complete;
	}

	public int getInProgress() {
		return inProgress;
	}

	public void setInProgress(int inProgress) {
		this.inProgress = inProgress;
	}


	public List<ProcessPath> getPath() {
		return path;
	}

	public void setPath(List<ProcessPath> path) {
		this.path = path;
	}

	@Override
	public String toString() {
		return "Process [processId=" + processId + ", name="
				+ name + ", key=" + key + ", resourceName=" + resourceName
				+ ", total=" + total + ", complete=" + complete
				+ ", inProgress=" + inProgress + ", path=" + path + "]";
	}

}
